package com.ciri.ssm.controller;


import com.ciri.ssm.entity.Book;
import com.ciri.ssm.entity.Users;
import com.ciri.ssm.service.BookService;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * 图书表(Book)表控制层
 *
 * @author makejava
 * @since 2024-05-09 15:10:11
 */
@RestController
@RequestMapping("book")
public class BookController {
    /**
     * 服务对象
     */
    @Autowired
    private BookService bookService;

     @RequestMapping(value = "/getlist", method = RequestMethod.GET)
    public List<Book> list() {
        return bookService.selectAll();
    }

   // @RequestMapping(value = "/{bookId}/queryById", method = RequestMethod.GET)
//    public Book queryById(@PathVariable("bookId") Long bookId) {
//        return bookService.queryById(bookId);
//    }
   @RequestMapping(value = "/queryById", method = RequestMethod.GET)
    public Book queryById(@RequestParam("bookId") Long bookId) {
        return bookService.queryById(bookId);
    }




}

